<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: testpattern</title>
  </head>
  <body>
  <table border="0" cellspacing="0" width="100%">
    <tr class="subheader">
      <td class="headertitle">M-File Help: testpattern</td>
      <td class="subheader-left"><a href="matlab:open testpattern">View code for testpattern</a></td>
    </tr>
  </table>
<h1>testpattern</h1><p><span class="helptopic">Create test images</span></p><p>
<strong>im</strong> = <span style="color:red">testpattern</span>(<strong>type</strong>, <strong>w</strong>, <strong>args</strong>) creates a test pattern image.  If <strong>w</strong> is a
scalar the image is WxW else <strong>w</strong>(2)xW(1).  The image is specified by the
string <strong>type</strong> and one or two (type specific) arguments:

</p>
<table class="list">
  <tr><td style="white-space: nowrap;" class="col1"> 'rampx'</td> <td>intensity ramp from 0 to 1 in the x-direction. ARGS is the number
of cycles.</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'rampy'</td> <td>intensity ramp from 0 to 1 in the y-direction. ARGS is the number
of cycles.</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'sinx'</td> <td>sinusoidal intensity pattern (from -1 to 1) in the x-direction.
ARGS is the number of cycles.</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'siny'</td> <td>sinusoidal intensity pattern (from -1 to 1) in the y-direction.
ARGS is the number of cycles.</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'dots'</td> <td>binary dot pattern.  ARGS are dot pitch (distance between
centres); dot diameter.</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'squares'</td> <td>binary square pattern.  ARGS are pitch (distance between
centres); square side length.</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'line'</td> <td>a line.  ARGS are theta (rad), intercept.</td></tr>
</table>
<h2>Examples</h2>
<p>
A 256x256 image with 2 cycles of a horizontal sawtooth intensity ramp:

</p>
<pre style="width: 90%%;" class="examples">
testpattern('rampx',&nbsp;256,&nbsp;2);
</pre>
<p>
A 256x256 image with a grid of dots on 50 pixel centres and 20 pixels in
diameter:

</p>
<pre style="width: 90%%;" class="examples">
testpattern('dots',&nbsp;256,&nbsp;50,&nbsp;25);
</pre>
<h2>Notes</h2>
<ul>
  <li>With no output argument the testpattern in displayed using idisp.</li>
</ul>
<h2>See also</h2>
<p>
<a href="matlab:doc idisp">idisp</a></p>
<hr>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr class="subheader" valign="top"><td>&nbsp;</td></tr></table>
<p class="copy">&copy; 1990-2012 Peter Corke.</p>
</body></html>